#pragma once

#include "../CCompilerBackend.hpp"
#include "Package.hpp"

namespace BuildNG
{
  class VCPackage;

  class VCCompilerBackend : public CCompilerBackend
  {
  public:
    static bool is_available();

    static Glib::RefPtr<VCCompilerBackend> create();

    virtual bool build_source_file(
      BuildContext&                 context,
      const Glib::ustring&          source_file_name,
      Glib::ustring&                obj_file_name,
      Glib::RefPtr<ErrorListener>   error_listener);

    virtual bool link(
      BuildContext&                 context,
      const std::vector<Glib::ustring> &object_files,
      Glib::RefPtr<ErrorListener>   error_listener);

    // settings related functions
    virtual void add_reference(Glib::RefPtr<CLangReference> reference);
    virtual void set_language(Language language) { this->language = language; }

  private:
    VCPackageSet                    packages;
    Language                        language;

    Glib::ustring                   get_cflags_pkg_args() const;
    Glib::ustring                   get_linker_pkg_args() const;
  };
}
